package com.parammatch.demo;

public class ParamMatchDemo {
    private String param1;
    private String param2;
    private String param3;
    private String param4;
    private String param5;

    public boolean matchParam(){
        boolean result = matchparam1("value1");
        if(result){
            result = matchparam2("value2");
        }
        if(result){
            result = matchparam3("value3");
        }
        if(result){
            result = matchparam4("value4");
        }
        if(result){
            result = matchparam5("value5");
        }
        return result;
    }

    private boolean matchparam1(String value1){
        if(param1!= null && param1.equals(value1)){
            return true;
        }
       return false;
    }
    private boolean matchparam2(String value2){
        if(param1!= null && param1.equals(value2)){
            return true;
        }
        return false;
    }
    private boolean matchparam3(String value3){
        if(param1!= null && param1.equals(value3)){
            return true;
        }
        return false;
    }
    private boolean matchparam4(String value4){
        if(param1!= null && param1.equals(value4)){
            return true;
        }
        return false;
    }
    private boolean matchparam5(String value5){
        if(param1!= null && param1.equals(value5)){
            return true;
        }
        return false;
    }

}
